/**
 * Copyright &copy; 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.modules.web.entity;

import javax.validation.constraints.NotNull;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.Length;

import com.jeeplus.core.persistence.DataEntity;
import com.jeeplus.common.utils.excel.annotation.ExcelField;

/**
 * 优惠券类型Entity
 * @author rongjie
 * @version 2017-08-06
 */
public class WxCouponType extends DataEntity<WxCouponType> {
	
	private static final long serialVersionUID = 1L;
	private String text;		// 内容
	private Integer money;		// 优惠金额
	private Integer threshold;		// 使用门槛（如0元无门槛  10元十元起）
	private Date time;		// 失效时间
	private String url;		// 封面
	private String title;		// 标题
	
	public WxCouponType() {
		super();
		this.setIdType(IDTYPE_AUTO);
	}

	public WxCouponType(String id){
		super(id);
	}

	@ExcelField(title="内容", align=2, sort=7)
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	
	@NotNull(message="优惠金额不能为空")
	@ExcelField(title="优惠金额", align=2, sort=8)
	public Integer getMoney() {
		return money;
	}

	public void setMoney(Integer money) {
		this.money = money;
	}
	
	@NotNull(message="使用门槛（如0元无门槛  10元十元起）不能为空")
	@ExcelField(title="使用门槛（如0元无门槛  10元十元起）", align=2, sort=9)
	public Integer getThreshold() {
		return threshold;
	}

	public void setThreshold(Integer threshold) {
		this.threshold = threshold;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@NotNull(message="失效时间不能为空")
	@ExcelField(title="失效时间", align=2, sort=10)
	public Date getTime() {
		return time;
	}

	public void setTime(Date time) {
		this.time = time;
	}
	
	@Length(min=1, max=99999, message="封面长度必须介于 1 和 99999 之间")
	@ExcelField(title="封面", align=2, sort=11)
	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}
	
	@Length(min=1, max=20, message="标题长度必须介于 1 和 20 之间")
	@ExcelField(title="标题", align=2, sort=12)
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}
	
}